﻿namespace DoNet.ORM.Repository
{
    public interface IRepository
    {
        long Insert<T>(T entity) where T : class, new();
        Task<long> InsertAsync<T>(T entity) where T : class, new();
        long Update<T>(T entity) where T : class, new();
        Task<long> UpdateAsync<T>(T entity) where T : class, new();
        long Delete<T>(T entity) where T : class, new();
        Task<long> DeleteAsync<T>(T entity) where T : class, new();
        T? GetById<T>(long id) where T : class, new();
        Task<T?> GetByIdAsync<T>(long id) where T : class, new();
        IEnumerable<T> GetAll<T>() where T : class, new();
        Task<IEnumerable<T>> GetAllAsync<T>() where T : class, new();
    }
}
